# -*- coding: utf-8 -*- 
#
# Description:
#
#  Definiton
#
#
#
# Changes:
#
# 2012-01-10
# Initial Commit
#
#
# Copyright 2010-2012, WyDev Team.
# Author: Polo35 (polo35580@hotmail.fr)
#
# Licenced under Academic Free License version 3.0
# Review WyGui README & LICENSE files for further details.

nname: 183
n 183(None)[context['selected'].show_menu()
return None
]:
	i: 25(), 77(JA), 110(JA), 178(), 181(AE)
	o: 

nname: 181
n 181(None)[]:
	i: 60(f)
	o: 183(AE)

nname: 178
n 178(None)[]:
	i: 176(AE)
	o: 183()

nname: 176
n 176(None)[]:
	i: 100(f)
	o: 178(AE)

nname: 110
n 110(None)[error_title = _('Impossible to cancel recording')
message = _('This recording has already started.')
MessageWindow(message, error_title, button=None).show(timeout=5)
return None
]:
	i: 100(t)
	o: 183(JA)

nname: 100
n 100(<dummy_ex3> EXC_MATCH SchedulerRecordingRunningError)[]:
	i: 70(except)
	o: 110(t), 176(f)

nname: 77
n 77(None)[scheduler.DeleteRecording(record.record.id)
]:
	i: 70(try)
	o: 183(JA)

nname: 70
n 70(None)[]:
	i: 60(t)
	o: 77(try), 100(except)

nname: 60
n 60(<dummy_ex3> EXC_MATCH AttributeError)[]:
	i: 0(except)
	o: 70(t), 181(f)

nname: 25
n 25(None)[rule_id = record.periodic_rule.id
scheduler.RemovePeriodicRecording(rule_id, delete_records=False)
]:
	i: 0(try)
	o: 183()

nname: 0
n 0(None)[record = context['selected']
scheduler = WyRecord().scheduler
]:
	i: 
	o: 25(try), 60(except)

nname: 183
n 183(None)[context['selected'].show_menu()
return None
]:
	i: 25(), 77(JA), 110(JA), 181(AE), 100(f), 176(AE)
	o: 

nname: 181
n 181(None)[]:
	i: 60(f)
	o: 183(AE)

nname: 110
n 110(None)[error_title = _('Impossible to cancel recording')
message = _('This recording has already started.')
MessageWindow(message, error_title, button=None).show(timeout=5)
return None
]:
	i: 100(t)
	o: 183(JA)

nname: 100
n 100(<dummy_ex3> EXC_MATCH SchedulerRecordingRunningError)[]:
	i: 70(except)
	o: 110(t), 183(f)

nname: 77
n 77(None)[scheduler.DeleteRecording(record.record.id)
]:
	i: 70(try)
	o: 183(JA)

nname: 70
n 70(None)[]:
	i: 60(t)
	o: 77(try), 100(except)

nname: 60
n 60(<dummy_ex3> EXC_MATCH AttributeError)[]:
	i: 0(except)
	o: 70(t), 181(f)

nname: 25
n 25(None)[rule_id = record.periodic_rule.id
scheduler.RemovePeriodicRecording(rule_id, delete_records=False)
]:
	i: 0(try)
	o: 183()

nname: 0
n 0(None)[record = context['selected']
scheduler = WyRecord().scheduler
]:
	i: 
	o: 25(try), 60(except)

nname: 183
n 183(None)[context['selected'].show_menu()
return None
]:
	i: 25(), 181(AE), 77(f)
	o: 

nname: 77
n 77(None)[try:
	scheduler.DeleteRecording(record.record.id)
except SchedulerRecordingRunningError:
	error_title = _('Impossible to cancel recording')
	message = _('This recording has already started.')
	MessageWindow(message, error_title, button=None).show(timeout=5)
	return None
]:
	i: 60(f), 60(t)
	o: 183(JA)

nname: 60
n 60(<dummy_ex3> EXC_MATCH AttributeError)[]:
	i: 0(except)
	o: 77(f)

nname: 25
n 25(None)[rule_id = record.periodic_rule.id
scheduler.RemovePeriodicRecording(rule_id, delete_records=False)
]:
	i: 0(try)
	o: 183()

nname: 0
n 0(None)[record = context['selected']
scheduler = WyRecord().scheduler
]:
	i: 
	o: 25(try), 60(except)

structureSingleExcept Exception 'NoneType' object has no attribute 'toNode'
nname: 183
n 183(None)[context['selected'].show_menu()
return None
]:
	i: 25(), 181(AE), 77(f)
	o: 

nname: 77
n 77(None)[try:
	scheduler.DeleteRecording(record.record.id)
except SchedulerRecordingRunningError:
	error_title = _('Impossible to cancel recording')
	message = _('This recording has already started.')
	MessageWindow(message, error_title, button=None).show(timeout=5)
	return None
]:
	i: 60(t), 0(except)
	o: 183(JA)

nname: 25
n 25(None)[rule_id = record.periodic_rule.id
scheduler.RemovePeriodicRecording(rule_id, delete_records=False)
]:
	i: 0(try)
	o: 183()

nname: 0
n 0(None)[record = context['selected']
scheduler = WyRecord().scheduler
]:
	i: 
	o: 25(try), 77(except)

nname: 77
n 77(None)[except:
	try:
		scheduler.DeleteRecording(record.record.id)
	except SchedulerRecordingRunningError:
		error_title = _('Impossible to cancel recording')
		message = _('This recording has already started.')
		MessageWindow(message, error_title, button=None).show(timeout=5)
		return None
context['selected'].show_menu()
return None
]:
	i: 60(t), 0()
	o: 

nname: 0
n 0(None)[record = context['selected']
scheduler = WyRecord().scheduler
try:
	rule_id = record.periodic_rule.id
	scheduler.RemovePeriodicRecording(rule_id, delete_records=False)
]:
	i: 
	o: 77()

self.nodes: {0: <unpyclib.structure.node instance at 0xb757ed2c>, 77: <unpyclib.structure.node instance at 0xb757e42c>}
nname: 0
n 0(None)[def __do_cancel(context):
	record = context['selected']
	scheduler = WyRecord().scheduler
	try:
		rule_id = record.periodic_rule.id
		scheduler.RemovePeriodicRecording(rule_id, delete_records=False)

ConfirmWindow(_('Are you sure ?'), confirm_action=__do_cancel, confirm_args=(context,)).show()
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb757b56c>}
nname: 18
n 18(None)[record_id = context['selected'].record.id
scheduler = WyRecord().scheduler
scheduler.UpdateRecordingName(record_id, kbd.text)
context['selected'].show_menu()
kbd.hide()
]:
	i: 9(), 17()
	o: 

nname: 17
n 17(None)[]:
	i: 0(t)
	o: 18()

nname: 9
n 9(None)[]:
	i: 0(f)
	o: 18()

nname: 0
n 0(kbd.text)[]:
	i: 
	o: 9(f), 17(t)

nname: 0
n 0(None)[if not kbd.text:
	pass
record_id = context['selected'].record.id
scheduler = WyRecord().scheduler
scheduler.UpdateRecordingName(record_id, kbd.text)
context['selected'].show_menu()
kbd.hide()
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb757bf4c>}
nname: 0
n 0(None)[def __do_rename(kbd):
	if not kbd.text:
		pass
	record_id = context['selected'].record.id
	scheduler = WyRecord().scheduler
	scheduler.UpdateRecordingName(record_id, kbd.text)
	context['selected'].show_menu()
	kbd.hide()

text = context['selected'].name
kbd = KeyboardWindow(_('Rename'), text=text, confirm_action=__do_rename)
kbd.show()
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb757b96c>}
nname: 97
n 97(None)[from pygui.window import ConfirmWindow, KeyboardWindow
def execute_cancel_record(context):
	def __do_cancel(context):
		record = context['selected']
		scheduler = WyRecord().scheduler
		try:
			rule_id = record.periodic_rule.id
			scheduler.RemovePeriodicRecording(rule_id, delete_records=False)

	ConfirmWindow(_('Are you sure ?'), confirm_action=__do_cancel, confirm_args=(context,)).show()

def execute_rename_record(context):
	def __do_rename(kbd):
		if not kbd.text:
			pass
		record_id = context['selected'].record.id
		scheduler = WyRecord().scheduler
		scheduler.UpdateRecordingName(record_id, kbd.text)
		context['selected'].show_menu()
		kbd.hide()

	text = context['selected'].name
	kbd = KeyboardWindow(_('Rename'), text=text, confirm_action=__do_rename)
	kbd.show()

]:
	i: 60(), 96()
	o: 

nname: 96
n 96(None)[]:
	i: 0(f)
	o: 97()

nname: 60
n 60(None)[from wyrecord import WyRecord
from wyrecord.exceptions import SchedulerRecordingRunningError
]:
	i: 0(t)
	o: 97()

nname: 0
n 0('tv' in plugins)[from __future__ import absolute_import
from pygui.config import plugins
from pygui.window import MessageWindow
]:
	i: 
	o: 60(t), 96(f)

nname: 0
n 0(None)[from __future__ import absolute_import
from pygui.config import plugins
from pygui.window import MessageWindow
if 'tv' in plugins:
	from wyrecord import WyRecord
	from wyrecord.exceptions import SchedulerRecordingRunningError
from pygui.window import ConfirmWindow, KeyboardWindow
def execute_cancel_record(context):
	def __do_cancel(context):
		record = context['selected']
		scheduler = WyRecord().scheduler
		try:
			rule_id = record.periodic_rule.id
			scheduler.RemovePeriodicRecording(rule_id, delete_records=False)

	ConfirmWindow(_('Are you sure ?'), confirm_action=__do_cancel, confirm_args=(context,)).show()

def execute_rename_record(context):
	def __do_rename(kbd):
		if not kbd.text:
			pass
		record_id = context['selected'].record.id
		scheduler = WyRecord().scheduler
		scheduler.UpdateRecordingName(record_id, kbd.text)
		context['selected'].show_menu()
		kbd.hide()

	text = context['selected'].name
	kbd = KeyboardWindow(_('Rename'), text=text, confirm_action=__do_rename)
	kbd.show()

]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb757288c>}
from __future__ import absolute_import
from pygui.config import plugins
from pygui.window import MessageWindow
if 'tv' in plugins:
	from wyrecord import WyRecord
	from wyrecord.exceptions import SchedulerRecordingRunningError
from pygui.window import ConfirmWindow, KeyboardWindow
def execute_cancel_record(context):
	def __do_cancel(context):
		record = context['selected']
		scheduler = WyRecord().scheduler
		try:
			rule_id = record.periodic_rule.id
			scheduler.RemovePeriodicRecording(rule_id, delete_records=False)

	ConfirmWindow(_('Are you sure ?'), confirm_action=__do_cancel, confirm_args=(context,)).show()

def execute_rename_record(context):
	def __do_rename(kbd):
		if not kbd.text:
			pass
		record_id = context['selected'].record.id
		scheduler = WyRecord().scheduler
		scheduler.UpdateRecordingName(record_id, kbd.text)
		context['selected'].show_menu()
		kbd.hide()

	text = context['selected'].name
	kbd = KeyboardWindow(_('Rename'), text=text, confirm_action=__do_rename)
	kbd.show()

